<template>
  <div>
    <div
      class="tsmask"
      :style="{ height: clientHeight + 'px' }"
      ref="homePage"
    >
      <img
        src="http://o6wndwjxn.qnssl.com/297c5201812131629509365.png"
        alt=""
        class="mack_img"
      >
      <div class="wzts">添加到我的小程序，方便下次使用</div>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      clientHeight: ''
    }
  },
  mounted () {
    // 获取浏览器可视区域高度
    this.clientHeight = `${document.documentElement.clientHeight}` // document.body.clientWidth;
    window.onresize = function temp () {
      this.clientHeight = `${document.documentElement.clientHeight}`
    }
  },
  watch: {
    clientHeight: function () {
      this.changeFixed(this.clientHeight)
    }
  },
  methods: {
    changeFixed (clientHeight) { // 动态修改样式
      // console.log(clientHeight)
      this.$refs.homePage.style.height = clientHeight + 'px'
    }
  }
}

</script>
<style>
.tsmask {
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 99999999999;
}
.mack_img {
  width: 57px;
  height: 203px;
  position: absolute;
  top: 2px;
  right: 97px;
}
.wzts {
  width: 250px;
  height: 44px;
  font-family: PingFangSC-Regular;
  font-size: 13px;
  font-weight: normal;
  font-stretch: normal;
  line-height: 44px;
  letter-spacing: 0px;
  color: #ffffff;
  text-align: center;
  background-color: #f29911;
  border-radius: 41px;
  position: absolute;
  top: 216px;
  right: 71px;
}
</style>
